﻿#region

using System;
using System.Collections.Generic;
using System.Web.Mvc;
using FluentValidation.Attributes;
using HouseHoldBudget.Core.Entities.Budgets;
using HouseHoldBudget.Framework.Mvc;
using HouseHoldBudget.Infrastructure;
using HouseHoldBudget.Models.User;
using HouseHoldBudget.Validator.Budgets;

#endregion

namespace HouseHoldBudget.Models.Budgets
{
    [Validator(typeof (BudgetValidator))]
    public class BudgetModel : MvcEntityModelBase
    {
        #region Constructors

        public BudgetModel()
        {
            BudgetActors = new List<BudgetUserModel>();
            BudgetCategories = new List<BudgetCategoryModel>();
            BudgetOwner = new BudgetUserModel();
        }

        #endregion

        #region Instance Properties

        /// <summary>
        ///   Gets or sets the budget actors.
        /// </summary>
        /// <value> The budget actors. </value>
        public List<BudgetUserModel> BudgetActors { get; set; }

        /// <summary>
        ///   Gets or sets the budget categories.
        /// </summary>
        /// <value> The budget categories. </value>
        public List<BudgetCategoryModel> BudgetCategories { get; set; }

        /// <summary>
        ///   Gets or sets the budget description.
        /// </summary>
        /// <value> The budget description. </value>
        [AllowHtml]
        [ResourceDisplayName("Common_Description")]
        public string BudgetDescription { get; set; }

        /// <summary>
        ///   Gets or sets the name of the budget.
        /// </summary>
        /// <value> The name of the budget. </value>
        [AllowHtml]
        [ResourceDisplayName("ManageMyBudgets_NameColumn")]
        public string BudgetName { get; set; }

        /// <summary>
        ///   Gets or sets the budget owner.
        /// </summary>
        /// <value> The budget owner. </value>
        public BudgetUserModel BudgetOwner { get; set; }

        /// <summary>
        ///   Gets or sets the created on.
        /// </summary>
        /// <value> The created on. </value>
        [AllowHtml]
        public DateTime CreatedOn { get; set; }

        /// <summary>
        ///   Gets or sets the update on.
        /// </summary>
        /// <value> The update on. </value>
        public DateTime UpdateOn { get; set; }

        /// <summary>
        /// Gets or sets the budget types.
        /// </summary>
        /// <value>
        /// The budget types.
        /// </value>
        [ResourceDisplayName("ManageMyBudgets_Type")]
        public List<SelectListItem> BudgetTypesItems { get; set; }

        /// <summary>
        ///   Gets or sets the type of the budget.
        /// </summary>
        /// <value> The type of the budget. </value>
        public int BudgetTypeId { get; set; }

        #endregion
    }
}